@charset "utf-8";

@import "module/var";
@import "module/normalize";
@import "module/article";
@import "module/code";
@import "module/tag-cloud";

$basic-transition-time: 0.4s;

.list-unstyled {
  padding: 0;
  list-style: none;
}

.list-inline {
  @extend .list-unstyled;

  li {
    display: inline-block;
  }
}

.hidden-xs {
  @media (max-width: 767px) {
    display: none !important;
  }
}

img {
  max-width: calc(100% - 10px);
  margin-left: 5px;
  margin-right: 5px;
  border-radius: 5px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  font-family: 'Microsoft YaHei', 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'WenQuanYi Micro Hei', sans-serif;
  font-size: 14px;
  background-color: #3e3e3e;

  @media (min-width: $screen-xlg) {
    font-size: 16px;
  }
}

#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 30vw;
  max-width: 360px;
  height: 100vh;
  background: #3e3e3e no-repeat 50% 50%;
  background-size: cover;
  color: #fff;
  text-align: right;
  text-shadow: 2px 2px 2px #000;
  box-shadow: 1px 0 5px rgba(0, 0, 0, .4);
}

#sidebar-inner-wrap {
  position: absolute;
  right: 15%;
  bottom: 40px;
  width: 70%;
  overflow: hidden;
}

#site-nav {
  float: right;
  margin-bottom: 50px;

  li {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  a {
    display: block;
    border-bottom: 1px solid transparent;
    -webkit-transition: border $basic-transition-time;
    -moz-transition: border $basic-transition-time;
    -ms-transition: border $basic-transition-time;
    -o-transition: border $basic-transition-time;
    transition: border $basic-transition-time;
  }

  a:hover,
  li.active a {
    text-decoration: none;
    border-bottom: 1px solid #fff;
  }
}

#site-intro {
  clear: both;

  p:first-child {
    font-size: 18px;
    margin-bottom: 10px;
  }
}

#image-source {
  display: block;
  position: absolute;
  bottom: 40px;
  left: 20px;
  width: 15px;
  height: 15px;
  line-height: 15px;
  text-align: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, .2);
  font-size: 12px;
  color: #c9c9c9;
  text-shadow: none;

  &,
  &::before {
    -webkit-transition: all .4s;
    -moz-transition: all .4s;
    -ms-transition: all .4s;
    -o-transition: all .4s;
    transition: all .4s;
  }

  &:hover,
  &::before {
    background-color: rgba(255, 255, 255, .8);
    color: #666;
  }

  &.align-left::before {
    left: 0;
  }

  &.align-right::before {
    right: 0;
  }

  &::before {
    content: attr(data-content);
    display: block;
    position: absolute;
    top: -20px;
    padding: 4px 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    font-size: 12px;
  }

  &:hover {
    text-decoration: none;

    &::before {
      top: -30px;
      opacity: 1;
      visibility: visible;
    }
  }
}

#main-container {
  margin-left: 30vw;
  min-height: 100vh;
  overflow: hidden;
  background-color: #fff;

  @media (min-width: 1200px) {
    margin-left: 360px;
  }
}

#main-inner-wrap {
  width: 80%;
  max-width: 700px;
  overflow: hidden;
  margin-top: 50px;
  margin-left: 12%;
}

#page-content {
  overflow: hidden;
  min-height: 70vh;
}

#page-article-list {
  margin-top: 50px;

  &::before {
    content: attr(data-content);
    display: block;
    margin-bottom: 20px;
  }

  section:not(:last-child) {
    margin-bottom: 40px;
  }

  h2 {
    margin-bottom: 20px;
  }

  article {
    &:not(:last-child) {
      margin-bottom: 20px;
    }

    h3 {
      font-weight: normal;
    }
  }

  .post-meta {
    margin-bottom: 0;
  }
}

#mastfoot {
  margin-top: 50px;
  margin-bottom: 15px;
  font-size: 12px;
  line-height: 1.6;
  color: #9e9e9e;
  text-align: center;

  a {
    text-decoration: underline;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  #sidebar {
    position: static;
    width: auto;
    height: auto;
    max-width: none;
    background-image: none !important;
    box-shadow: none;
  }

  #sidebar-inner-wrap {
    width: 100%;
    position: static;
    right: auto;
    bottom: auto;
  }

  #site-nav {
    float: none;
    margin: 0;
    text-align: center;

    ul {
      display: table;
      width: 100%;
      table-layout: fixed;
      line-height: 40px;
    }

    li {
      display: table-cell;
    }

    a,
    a:hover,
    li.active a {
      border-bottom: none;
    }
  }

  #site-intro {
    display: none;
  }

  #main-container {
    margin-left: 0;
    padding-left: 20px;
    padding-right: 20px;
  }

  #main-inner-wrap {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  #page-content {
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: $screen-xlg) {
  #main-inner-wrap {
    left: 15%;
  }
}